class BlogController < Base::BlogBaseController
    
  layout 'blog_public'

  #添加评论
  def add_commnet
    if simple_captcha_valid?
      @blog=Blog.find(params[:id])
      comment=Comment.new(params[:comment])
      if @blog.comments<<comment
        @comments=Comment.paginate_by('blog', @blog.id, params[:page])
        redirect_to :action=>'view', :id=>@blog.id
      else
        render :action=>:add_commnet
      end
    end
  end
end